package com.joysuch.wwyt.patrol.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.joysuch.wwyt.core.common.ajax.ResultBean;
import com.joysuch.wwyt.core.exception.ApiBusinessException;
import com.joysuch.wwyt.patrol.entity.PatrolCheckPoint;
import com.joysuch.wwyt.patrol.entity.bean.PatrolCheckPointBean;
import com.joysuch.wwyt.patrol.entity.bean.SimpleListDataType;
import com.joysuch.wwyt.patrol.entity.vo.CheckPlanDetailPointVo;
import com.joysuch.wwyt.patrol.entity.vo.CheckPointDetailVo;
import com.joysuch.wwyt.patrol.entity.vo.CheckPointListVo;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;

import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author zr
 * @since 2022-02-28
 */
public interface PatrolCheckPointService extends IService<PatrolCheckPoint> {

    List<CheckPlanDetailPointVo> findPlanPointByPlanId(Long planId);

    void saveCheckPoint(PatrolCheckPointBean patrolCheckPointBean) throws ApiBusinessException;

    /**
     * 检查点分页
     * @param page
     * @param size
     * @param areaId
     * @return
     */
    ResultBean findListForPage(Integer page, Integer size, Long areaId , Long typeId , String pointName);

    CheckPointDetailVo getPointById(Long id);

    void updateCheckPoint(PatrolCheckPointBean bean) throws ApiBusinessException;

    /**
     * 获取检查点列表
     * @return
     */
    List<CheckPointListVo> getPointList();

    /**
     * 根据检查点id删除检查点
     * @param id
     * @param skipFlag 0：不跳校验 1: 直接删除跳过校验
     * @return
     */
    ResultBean deletePointById(Long id, Integer skipFlag);

    /**
     * 根据flag查询数据类型下拉列表
     * @param flag
     * @return
     */
    List<SimpleListDataType> getSimpleListDataType(String flag);

    /**
     * App做任务时根据检查点
     * @param pointId
     * @return
     */
    CheckPointDetailVo getCheckPointByPointIdForApp(Long pointId);

    /**
     * 导出检查项目模板
     * @return
     */
    XSSFWorkbook exportCheckItemTem();

    /**
     * 获取检查点位置，检查点无点位则取区域位置
     * @param id
     * @return
     */
    String getLocationById(Long id);

    /**
     * 导出检查点下的检查项目
     * @param pointId
     * @return
     */
    XSSFWorkbook exportCheckItemData(Long pointId);

    String findNameById(Long pointId);
}
